-- show_key
-- Created by chengb Mar/24/2016
-- 侦测钥匙的位置（本层有效）

return {
    apply = function(source, target, classId, value)
        for pos = 1, GRID_SIZE do
            local grid = DungeonM.getGridByPos(pos);
            if grid:isMonster() and grid.has_key == 1 then
                if grid.monster.dbase:query("show_key") ~= 1 and not grid.monster:isBoss() then
                    grid.monster.dbase:set("show_key", 1);
                    EventMgr.fire(event.MARK_MONSTER, {["pos"] = grid:getPos(),});
                end
                break;
            end
        end
    end,
}